<template>
  <div>
    <div class="top">系统中心</div>
    <div class="child-app-wrap">
      <div
        class="app-item"
        v-for="(app, index) in menus"
        :key="index"
        @click="handleAppClk(app)"
      >
        {{ app.name }}
      </div>
    </div>
  </div>
</template>
<script>
import { MENUS } from "@/core/child-projects-config"

export default {
  data() {
    return {
      menus: MENUS,
    }
  },
  mounted() {
    const vipUserDataStr =
      '{"userId":1415,"accessToken":"ee1accf87c9b08640b537d32bf71a22f","mobile":"11666666666","headImg":"avatar/owner_1415.jpg","name":"洋洋洋","openid":null,"walletCode":10000757,"authed":2,"company":null,"shortName":"abcd","childId":0,"logo":null,"tradeAuth":1,"role":2,"domain":"https://clx-dev.oss-cn-beijing.aliyuncs.com/","equipmentFlag":0,"placeId":null,"placeName":null,"truckNo":null}'
    sessionStorage.setItem("data", vipUserDataStr)
  },
  computed: {},
  methods: {
    handleAppClk(app) {
      this.$router.push(`/child${app.link}`)
    },
  },
}
</script>
<style scoped lang="less">
.top {
  height: 60px;
  line-height: 60px;
  text-align: center;
  font-weight: 600;
  font-size: 28px;
  margin-bottom: 60px;
}
.child-app-wrap {
  display: flex;
  justify-content: center;
}
.app-item {
  border: 1px solid #333;
  margin-right: 20px;
  padding: 30px;
  border-radius: 8px;
  cursor: pointer;
  &:hover {
    color: #ea5529;
    border-color: #ea5529;
  }
}
</style>
